package com.cqhfan.api.clients.user.fallback;

import com.cqhfan.api.clients.user.FollowClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Collections;
import java.util.List;

/**
 * @author 眭传洪
 * @create 2025-08-03 0:21
 */
@Slf4j
public class FollowClientFallbackFactory implements FallbackFactory<FollowClient> {

    @Override
    public FollowClient create(Throwable cause) {
        return new FollowClient() {
            @Override
            public List<Long> listByUserId(Long userId) {
                log.info("根据用户id查询关注信息失败");
                return Collections.emptyList();
            }

            @Override
            public List<Long> listFriend(Long userId) {
                log.info("根据用户id查询朋友信息失败");
                return Collections.emptyList();
            }
        };

    }
}
